<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition>

	<h:outputText value="Living Room" styleClass="label label-primary" />
	<h:form>
		<div class="panel panel-default">


				<div class="panel-heading">

						<h:outputText value="#{messages.ALARM}" styleClass="panel-title" />

				</div>
				<div class="panel-body">
					<h:outputLabel for="alarmTime" value="#{messages.HORA}"
						styleClass="label label-default" />
					<h:inputText id="alarmTime" value="#{livingRoomBean.currentAlarm}"
						size="5" styleClass="txt_textbox" required="true"
						requiredMessage="hh:mm">
						<f:validateLength minimum="5" maximum="5" />
					</h:inputText>
					<h:message for="alarmTime" styleClass="errorMessage" />
					<h:selectOneRadio value="#{livingRoomBean.alarmOption}">
						<f:selectItems value="#{livingRoomBean.alarmOptionValue}" />
						<f:ajax render="alarmSound" />
					</h:selectOneRadio>
					<h:panelGroup id="alarmSound" layout="block">
						<h:inputText value="#{livingRoomBean.voice}" id="voice"
							rendered="#{livingRoomBean.alarmOption == 1}" />
						<h:selectOneMenu id="music"
							rendered="#{livingRoomBean.alarmOption == 2}"
							value="#{livingRoomBean.musicCollection}">
							<f:selectItems value="#{livingRoomBean.musicCollectionValue}" />
						</h:selectOneMenu>
					</h:panelGroup>

						<h:panelGroup style="display:block; text-align:center">
							<h:commandButton id="newAlarm" type="submit" value="New Alarm"
								action="#{livingRoomBean.saveAlarm}" styleClass="txt_botao1" />
							<h:commandButton type="submit" id="clear" value="Clear"
								action="#{livingRoomBean.clearAlarm}" styleClass="txt_botao1" />
						</h:panelGroup>

				</div>

		</div>
	</h:form>


</ui:composition>

</html>